package file;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

//OutputStream的使用
public class Demo6 {
    public static void main(String[] args) {
        try(OutputStream outputStream = new FileOutputStream("./output.txt",true)){//第二个参数决定是否是追加写
//            //一个一个字节写
//            outputStream.write(97);
//            outputStream.write(98);
//            outputStream.write(99);

            //多个字节一起写
            byte[] bytes = {97,98,99};
            outputStream.write(bytes);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
